@extends('admin.layout._back')

@section('content-header')
@parent
          <h1>
              {{ $class->title }}
            <small>子标签管理</small>
          </h1>
          <ol class="breadcrumb">
            <li><a href="{{ site_url('dashboard', 'admin') }}"><i class="fa fa-dashboard"></i> 主页</a></li>
            <li class="active">{{ $class->title }} 子标签管理 - 列表</li>
          </ol>
@stop

@section('content')

              @if(session()->has('message'))
                <div class="alert alert-success alert-dismissable">
                  <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                  <h4>  <i class="icon fa fa-check"></i> 提示！</h4>
                  {{ session('message') }}
                </div>
              @endif

              {{--@can('tag-write')--}}
              <a href="{{ url('admin/tag/create?'.'pid='.$class->id) }}" class="btn btn-primary margin-bottom">新增子标签</a>
              @if($class->level>2)
                  <a href="{{ url('/admin/tag/manage',['id'=>$class->pid]) }}" class="btn btn-primary margin-bottom">返回上级</a>
                  @else
                  <a href="{{ _route('admin:tag') }}" class="btn btn-primary margin-bottom">返回上级</a>
                  @endif
              {{--@endcan--}}

              <div class="box box-primary">
                <div class="box-header with-border">
                  <h3 class="box-title">标签列表</h3>
                </div><!-- /.box-header -->
                <div class="box-body table-responsive">
                  <table class="table table-hover table-bordered">
                    <tbody>
                      <!--tr-th start-->
                      <tr>
                        <th>编号</th>
                        <th>表示名</th>
                        <th>展示名</th>
                        <th>说明</th>
                        <th>排序</th>
                        <th>创建日期</th>
                        <th>更新日期</th>
                          <th>操作</th>
                      </tr>
                      <!--tr-th end-->

                      @foreach ($tags as $tag)
                      <tr>
                        <td class="text-muted">{{ $tag->id }}</td>
                        <td class="text-green">{!! str_repeat('---',($tag->level)-2) !!}{{ $tag->name }}</td>
                        <td class="text-green">{{ $tag->title }}</td>
                        <td class="text-red">{{ $tag->description }}</td>
                        <td class="text-red">{{ $tag->sort }}</td>
                        <td>{{ $tag->created_at }}</td>
                        <td>{{ $tag->updated_at }}</td>
                          <td>
                              {{--@can('tag-write')--}}
                              <a href="{{ url('admin/tag/destroyOne', $tag->id) }}"><i class="fa fa-fw fa-pencil" title="删除"></i></a>
                              <a href="{{ _route('admin:tag.edit', $tag->id) }}"><i class="fa fa-fw fa-pencil" title="修改"></i></a>
                              <a href="{{ url('admin/tag/manage', $tag->id) }}"><i class="fa fa-fw fa-pencil" title="管理"></i></a>
                              {{--@endcan--}}
                              <a href="javascript:void(0);"><i class="fa fa-fw fa-link" title="预览"></i></a>
                          </td>
                      </tr>
                      @endforeach

                    </tbody>
                  </table>
                </div><!-- /.box-body -->
              </div>
@stop

